import { get, post, del, put } from "@/utils/request";
import { type staffParams, type staffListData, type addData, type staffListtReturn } from "./type";

// 员工列表
export const staffList = (data: staffParams) => {
  return get<staffParams, staffListtReturn>("/api/staff/list", data);
};

// 员工添加
export const staffAdd = (data: addData) => {
  return post<addData, staffListData>("/api/staff/add", data);
};

// 删除
export const staffDel = (id: number) => {
  return del<number, null>(`/api/staff/delete/${id}`);
};

// 批量删除
export const staffDelAll = (data: number[]) => {
  return post<number[], null>("/api/staff/deleteAll", data);
};

// 获取单条数据
export const staffGet = (id: number) => {
  return get<number, staffListData>(`/api/staff/get/${id}`);
};

// 修改
export const staffUpdate = (data: staffListData) => {
  return put<staffListData, staffListData>("/api/staff/update", data);
};

// 护工添加
export const staffCarerAdd = (data: number[]) => {
  return post<number[], null>('/api/staff/careradd', data)
}

// 护工删除
export const staffCarerDel = (id: number) => {
  return del<number, null>(`/api/staff/carerDelete/${id}`)
}
